import axios from "../utils/request";
// 登录  /admin/login  post请求
export const login = data => axios({
    url: "http://192.168.102.39:8001/v2/login",
    method: "post",
    data
})
// 获取验证码  /v1/captchas
export const captchas = () => axios({
    url: "/v1/captchas",
    method: "post"
})
// 获取用户信息  /v1/user
export const user = () => axios({
    url: "/v1/user",
    method: 'get'
})
// 获取用户密码  /v2/changepassword
export const changepasswor = data => axios({
    url: "/v2/changepassword",
    method: "post",
    data
})
// 食品信息  /shopping/v2/menu
export const menu = (params) => axios({
    url: "/shopping/v2/foods",
    method: "get",
    params

})

// 价格
export const commodity_snapshot = (user_id, order_id) => axios({
    url: "/bos/v1/users/" + user_id + "/orders/" + order_id + "/snapshot",
    method: 'get',

})


// 订单列表
export const list = query => axios({
    url: '/bos/orders?offset=0&limit=20',
    method: 'get',
    query
})

// 服务中心
export function explain() {
    return axios({
        url: '/v3/profile/explain',
    })
}


// 搜索商家  /v4/restaurants get  query
export const restaurants = query =>
    axios({
        url: ' /v4/restaurants',
        method: 'get',
        query,
    })

